<html><!-- Created using the cpp_pretty_printer from the dlib C++ library.  See http://dlib.net for updates. --><head><title>dlib C++ Library - box_overlap_testing.h</title></head><body bgcolor='white'><pre>
<font color='#009900'>// Copyright (C) 2011  Davis E. King (davis@dlib.net)
</font><font color='#009900'>// License: Boost Software License   See LICENSE.txt for the full license.
</font><font color='#0000FF'>#ifndef</font> DLIB_BOX_OVERlAP_TESTING_Hh_
<font color='#0000FF'>#define</font> DLIB_BOX_OVERlAP_TESTING_Hh_

<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='box_overlap_testing_abstract.h.html'>box_overlap_testing_abstract.h</a>"
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../geometry.h.html'>../geometry.h</a>"
<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>vector<font color='#5555FF'>&gt;</font>

<font color='#0000FF'>namespace</font> dlib
<b>{</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>inline</font> <font color='#0000FF'><u>double</u></font> <b><a name='box_intersection_over_union'></a>box_intersection_over_union</b> <font face='Lucida Console'>(</font>
        <font color='#0000FF'>const</font> drectangle<font color='#5555FF'>&amp;</font> a,
        <font color='#0000FF'>const</font> drectangle<font color='#5555FF'>&amp;</font> b
    <font face='Lucida Console'>)</font> 
    <b>{</b>
        <font color='#0000FF'>const</font> <font color='#0000FF'><u>double</u></font> inner <font color='#5555FF'>=</font> a.<font color='#BB00BB'>intersect</font><font face='Lucida Console'>(</font>b<font face='Lucida Console'>)</font>.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
        <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>inner <font color='#5555FF'>=</font><font color='#5555FF'>=</font> <font color='#979000'>0</font><font face='Lucida Console'>)</font>
            <font color='#0000FF'>return</font> <font color='#979000'>0</font>;
        <font color='#0000FF'>const</font> <font color='#0000FF'><u>double</u></font> outer <font color='#5555FF'>=</font> <font face='Lucida Console'>(</font>a<font color='#5555FF'>+</font>b<font face='Lucida Console'>)</font>.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
        <font color='#0000FF'>return</font> inner<font color='#5555FF'>/</font>outer;
    <b>}</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>inline</font> <font color='#0000FF'><u>double</u></font> <b><a name='box_intersection_over_union'></a>box_intersection_over_union</b> <font face='Lucida Console'>(</font>
        <font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&amp;</font> a,
        <font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&amp;</font> b
    <font face='Lucida Console'>)</font> 
    <b>{</b>
        <font color='#0000FF'>return</font> <font color='#BB00BB'>box_intersection_over_union</font><font face='Lucida Console'>(</font><font color='#BB00BB'>drectangle</font><font face='Lucida Console'>(</font>a<font face='Lucida Console'>)</font>,<font color='#BB00BB'>drectangle</font><font face='Lucida Console'>(</font>b<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
    <b>}</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>inline</font> <font color='#0000FF'><u>double</u></font> <b><a name='box_percent_covered'></a>box_percent_covered</b> <font face='Lucida Console'>(</font>
        <font color='#0000FF'>const</font> drectangle<font color='#5555FF'>&amp;</font> a,
        <font color='#0000FF'>const</font> drectangle<font color='#5555FF'>&amp;</font> b
    <font face='Lucida Console'>)</font> 
    <b>{</b>
        <font color='#0000FF'>const</font> <font color='#0000FF'><u>double</u></font> inner <font color='#5555FF'>=</font> a.<font color='#BB00BB'>intersect</font><font face='Lucida Console'>(</font>b<font face='Lucida Console'>)</font>.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
        <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>inner <font color='#5555FF'>=</font><font color='#5555FF'>=</font> <font color='#979000'>0</font><font face='Lucida Console'>)</font>
            <font color='#0000FF'>return</font> <font color='#979000'>0</font>;
        <font color='#0000FF'>return</font> std::<font color='#BB00BB'>max</font><font face='Lucida Console'>(</font>inner<font color='#5555FF'>/</font>a.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>, inner<font color='#5555FF'>/</font>b.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
    <b>}</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>inline</font> <font color='#0000FF'><u>double</u></font> <b><a name='box_percent_covered'></a>box_percent_covered</b> <font face='Lucida Console'>(</font>
        <font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&amp;</font> a,
        <font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&amp;</font> b
    <font face='Lucida Console'>)</font> 
    <b>{</b>
        <font color='#0000FF'>return</font> <font color='#BB00BB'>box_percent_covered</font><font face='Lucida Console'>(</font><font color='#BB00BB'>drectangle</font><font face='Lucida Console'>(</font>a<font face='Lucida Console'>)</font>, <font color='#BB00BB'>drectangle</font><font face='Lucida Console'>(</font>b<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>;
    <b>}</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>class</font> <b><a name='test_box_overlap'></a>test_box_overlap</b>
    <b>{</b>
    <font color='#0000FF'>public</font>:
        <b><a name='test_box_overlap'></a>test_box_overlap</b> <font face='Lucida Console'>(</font>
        <font face='Lucida Console'>)</font> : iou_thresh<font face='Lucida Console'>(</font><font color='#979000'>0.5</font><font face='Lucida Console'>)</font>, percent_covered_thresh<font face='Lucida Console'>(</font><font color='#979000'>1.0</font><font face='Lucida Console'>)</font>
        <b>{</b><b>}</b>

        <font color='#0000FF'>explicit</font> <b><a name='test_box_overlap'></a>test_box_overlap</b> <font face='Lucida Console'>(</font>
            <font color='#0000FF'><u>double</u></font> iou_thresh_,
            <font color='#0000FF'><u>double</u></font> percent_covered_thresh_ <font color='#5555FF'>=</font> <font color='#979000'>1.0</font>
        <font face='Lucida Console'>)</font> : iou_thresh<font face='Lucida Console'>(</font>iou_thresh_<font face='Lucida Console'>)</font>, percent_covered_thresh<font face='Lucida Console'>(</font>percent_covered_thresh_<font face='Lucida Console'>)</font> 
        <b>{</b>
            <font color='#009900'>// make sure requires clause is not broken
</font>            <font color='#BB00BB'>DLIB_ASSERT</font><font face='Lucida Console'>(</font><font color='#979000'>0</font> <font color='#5555FF'>&lt;</font><font color='#5555FF'>=</font> iou_thresh <font color='#5555FF'>&amp;</font><font color='#5555FF'>&amp;</font> iou_thresh <font color='#5555FF'>&lt;</font><font color='#5555FF'>=</font> <font color='#979000'>1</font>  <font color='#5555FF'>&amp;</font><font color='#5555FF'>&amp;</font>
                        <font color='#979000'>0</font> <font color='#5555FF'>&lt;</font><font color='#5555FF'>=</font> percent_covered_thresh <font color='#5555FF'>&amp;</font><font color='#5555FF'>&amp;</font> percent_covered_thresh <font color='#5555FF'>&lt;</font><font color='#5555FF'>=</font> <font color='#979000'>1</font>,
                "<font color='#CC0000'>\t test_box_overlap::test_box_overlap(iou_thresh, percent_covered_thresh)</font>"
                <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> "<font color='#CC0000'>\n\t Invalid inputs were given to this function </font>"
                <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> "<font color='#CC0000'>\n\t iou_thresh:   </font>" <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> iou_thresh
                <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> "<font color='#CC0000'>\n\t percent_covered_thresh: </font>" <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> percent_covered_thresh
                <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> "<font color='#CC0000'>\n\t this: </font>" <font color='#5555FF'>&lt;</font><font color='#5555FF'>&lt;</font> <font color='#0000FF'>this</font>
                <font face='Lucida Console'>)</font>;

        <b>}</b>

        <font color='#0000FF'><u>bool</u></font> <b><a name='operator'></a>operator</b><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font face='Lucida Console'>(</font>
            <font color='#0000FF'>const</font> dlib::rectangle<font color='#5555FF'>&amp;</font> a,
            <font color='#0000FF'>const</font> dlib::rectangle<font color='#5555FF'>&amp;</font> b
        <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
        <b>{</b>
            <font color='#0000FF'>const</font> <font color='#0000FF'><u>double</u></font> inner <font color='#5555FF'>=</font> a.<font color='#BB00BB'>intersect</font><font face='Lucida Console'>(</font>b<font face='Lucida Console'>)</font>.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
            <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>inner <font color='#5555FF'>=</font><font color='#5555FF'>=</font> <font color='#979000'>0</font><font face='Lucida Console'>)</font>
                <font color='#0000FF'>return</font> <font color='#979000'>false</font>;

            <font color='#0000FF'>const</font> <font color='#0000FF'><u>double</u></font> outer <font color='#5555FF'>=</font> <font face='Lucida Console'>(</font>a<font color='#5555FF'>+</font>b<font face='Lucida Console'>)</font>.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
            <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>inner<font color='#5555FF'>/</font>outer <font color='#5555FF'>&gt;</font> iou_thresh <font color='#5555FF'>|</font><font color='#5555FF'>|</font> 
                inner<font color='#5555FF'>/</font>a.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>&gt;</font> percent_covered_thresh <font color='#5555FF'>|</font><font color='#5555FF'>|</font> 
                inner<font color='#5555FF'>/</font>b.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font> <font color='#5555FF'>&gt;</font> percent_covered_thresh<font face='Lucida Console'>)</font>
                <font color='#0000FF'>return</font> <font color='#979000'>true</font>;
            <font color='#0000FF'>else</font>
                <font color='#0000FF'>return</font> <font color='#979000'>false</font>;
        <b>}</b>

        <font color='#0000FF'><u>double</u></font> <b><a name='get_percent_covered_thresh'></a>get_percent_covered_thresh</b> <font face='Lucida Console'>(</font>
        <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
        <b>{</b>
            <font color='#0000FF'>return</font> percent_covered_thresh;
        <b>}</b>

        <font color='#0000FF'><u>double</u></font> <b><a name='get_iou_thresh'></a>get_iou_thresh</b> <font face='Lucida Console'>(</font>
        <font face='Lucida Console'>)</font> <font color='#0000FF'>const</font>
        <b>{</b>
            <font color='#0000FF'>return</font> iou_thresh;
        <b>}</b>

    <font color='#0000FF'>private</font>:
        <font color='#0000FF'><u>double</u></font> iou_thresh;
        <font color='#0000FF'><u>double</u></font> percent_covered_thresh;
    <b>}</b>;

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>inline</font> <font color='#0000FF'><u>void</u></font> <b><a name='serialize'></a>serialize</b> <font face='Lucida Console'>(</font>
        <font color='#0000FF'>const</font> test_box_overlap<font color='#5555FF'>&amp;</font> item,
        std::ostream<font color='#5555FF'>&amp;</font> out
    <font face='Lucida Console'>)</font>
    <b>{</b>
        <font color='#BB00BB'>serialize</font><font face='Lucida Console'>(</font>item.<font color='#BB00BB'>get_iou_thresh</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>, out<font face='Lucida Console'>)</font>;
        <font color='#BB00BB'>serialize</font><font face='Lucida Console'>(</font>item.<font color='#BB00BB'>get_percent_covered_thresh</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>, out<font face='Lucida Console'>)</font>;
    <b>}</b>

    <font color='#0000FF'>inline</font> <font color='#0000FF'><u>void</u></font> <b><a name='deserialize'></a>deserialize</b> <font face='Lucida Console'>(</font>
        test_box_overlap<font color='#5555FF'>&amp;</font> item,
        std::istream<font color='#5555FF'>&amp;</font> in 
    <font face='Lucida Console'>)</font>
    <b>{</b>
        <font color='#0000FF'><u>double</u></font> percent_covered_thresh, iou_thresh;
        <font color='#BB00BB'>deserialize</font><font face='Lucida Console'>(</font>iou_thresh, in<font face='Lucida Console'>)</font>;
        <font color='#BB00BB'>deserialize</font><font face='Lucida Console'>(</font>percent_covered_thresh, in<font face='Lucida Console'>)</font>;
        item <font color='#5555FF'>=</font> <font color='#BB00BB'>test_box_overlap</font><font face='Lucida Console'>(</font>iou_thresh, percent_covered_thresh<font face='Lucida Console'>)</font>;
    <b>}</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>inline</font> test_box_overlap <b><a name='find_tight_overlap_tester'></a>find_tight_overlap_tester</b> <font face='Lucida Console'>(</font>
        <font color='#0000FF'>const</font> std::vector<font color='#5555FF'>&lt;</font>std::vector<font color='#5555FF'>&lt;</font>rectangle<font color='#5555FF'>&gt;</font> <font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> rects
    <font face='Lucida Console'>)</font>
    <b>{</b>
        <font color='#0000FF'><u>double</u></font> max_pcov <font color='#5555FF'>=</font> <font color='#979000'>0</font>;
        <font color='#0000FF'><u>double</u></font> max_iou_score <font color='#5555FF'>=</font> <font color='#979000'>0</font>;
        <font color='#0000FF'>for</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> i <font color='#5555FF'>=</font> <font color='#979000'>0</font>; i <font color='#5555FF'>&lt;</font> rects.<font color='#BB00BB'>size</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <font color='#5555FF'>+</font><font color='#5555FF'>+</font>i<font face='Lucida Console'>)</font>
        <b>{</b>
            <font color='#0000FF'>for</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> j <font color='#5555FF'>=</font> <font color='#979000'>0</font>; j <font color='#5555FF'>&lt;</font> rects[i].<font color='#BB00BB'>size</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <font color='#5555FF'>+</font><font color='#5555FF'>+</font>j<font face='Lucida Console'>)</font>
            <b>{</b>
                <font color='#0000FF'>for</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> k <font color='#5555FF'>=</font> j<font color='#5555FF'>+</font><font color='#979000'>1</font>; k <font color='#5555FF'>&lt;</font> rects[i].<font color='#BB00BB'>size</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <font color='#5555FF'>+</font><font color='#5555FF'>+</font>k<font face='Lucida Console'>)</font>
                <b>{</b>
                    <font color='#0000FF'>const</font> rectangle a <font color='#5555FF'>=</font> rects[i][j];
                    <font color='#0000FF'>const</font> rectangle b <font color='#5555FF'>=</font> rects[i][k];
                    <font color='#0000FF'>const</font> <font color='#0000FF'><u>double</u></font> iou_score <font color='#5555FF'>=</font> <font face='Lucida Console'>(</font>a.<font color='#BB00BB'>intersect</font><font face='Lucida Console'>(</font>b<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>/</font><font face='Lucida Console'>(</font><font color='#0000FF'><u>double</u></font><font face='Lucida Console'>)</font><font face='Lucida Console'>(</font>a<font color='#5555FF'>+</font>b<font face='Lucida Console'>)</font>.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
                    <font color='#0000FF'>const</font> <font color='#0000FF'><u>double</u></font> pcov_a   <font color='#5555FF'>=</font> <font face='Lucida Console'>(</font>a.<font color='#BB00BB'>intersect</font><font face='Lucida Console'>(</font>b<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>/</font><font face='Lucida Console'>(</font><font color='#0000FF'><u>double</u></font><font face='Lucida Console'>)</font><font face='Lucida Console'>(</font>a<font face='Lucida Console'>)</font>.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;
                    <font color='#0000FF'>const</font> <font color='#0000FF'><u>double</u></font> pcov_b   <font color='#5555FF'>=</font> <font face='Lucida Console'>(</font>a.<font color='#BB00BB'>intersect</font><font face='Lucida Console'>(</font>b<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font><font color='#5555FF'>/</font><font face='Lucida Console'>(</font><font color='#0000FF'><u>double</u></font><font face='Lucida Console'>)</font><font face='Lucida Console'>(</font>b<font face='Lucida Console'>)</font>.<font color='#BB00BB'>area</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>;

                    <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>iou_score <font color='#5555FF'>&gt;</font> max_iou_score<font face='Lucida Console'>)</font>
                        max_iou_score <font color='#5555FF'>=</font> iou_score;

                    <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>pcov_a <font color='#5555FF'>&gt;</font> max_pcov<font face='Lucida Console'>)</font>
                        max_pcov <font color='#5555FF'>=</font> pcov_a;
                    <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font>pcov_b <font color='#5555FF'>&gt;</font> max_pcov<font face='Lucida Console'>)</font>
                        max_pcov <font color='#5555FF'>=</font> pcov_b;
                <b>}</b>
            <b>}</b>
        <b>}</b>

        <font color='#009900'>// Relax these thresholds very slightly.  We do this because on some systems the
</font>        <font color='#009900'>// boxes that generated the max values erroneously trigger a box overlap iou even
</font>        <font color='#009900'>// though their percent covered and iou values are *equal* to the thresholds but
</font>        <font color='#009900'>// not greater.  That is, sometimes when double values get moved around they change
</font>        <font color='#009900'>// their values slightly, so this avoids the problems that can create.
</font>        max_iou_score <font color='#5555FF'>=</font> std::<font color='#BB00BB'>min</font><font face='Lucida Console'>(</font><font color='#979000'>1.0000001</font><font color='#5555FF'>*</font>max_iou_score, <font color='#979000'>1.0</font><font face='Lucida Console'>)</font>;
        max_pcov     <font color='#5555FF'>=</font> std::<font color='#BB00BB'>min</font><font face='Lucida Console'>(</font><font color='#979000'>1.0000001</font><font color='#5555FF'>*</font>max_pcov,     <font color='#979000'>1.0</font><font face='Lucida Console'>)</font>;
        <font color='#0000FF'>return</font> <font color='#BB00BB'>test_box_overlap</font><font face='Lucida Console'>(</font>max_iou_score, max_pcov<font face='Lucida Console'>)</font>;
    <b>}</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>inline</font> <font color='#0000FF'><u>bool</u></font> <b><a name='overlaps_any_box'></a>overlaps_any_box</b> <font face='Lucida Console'>(</font>
        <font color='#0000FF'>const</font> test_box_overlap<font color='#5555FF'>&amp;</font> tester,
        <font color='#0000FF'>const</font> std::vector<font color='#5555FF'>&lt;</font>rectangle<font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> rects,
        <font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&amp;</font> rect
    <font face='Lucida Console'>)</font>
    <b>{</b>
        <font color='#0000FF'>for</font> <font face='Lucida Console'>(</font><font color='#0000FF'><u>unsigned</u></font> <font color='#0000FF'><u>long</u></font> i <font color='#5555FF'>=</font> <font color='#979000'>0</font>; i <font color='#5555FF'>&lt;</font> rects.<font color='#BB00BB'>size</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>; <font color='#5555FF'>+</font><font color='#5555FF'>+</font>i<font face='Lucida Console'>)</font>
        <b>{</b>
            <font color='#0000FF'>if</font> <font face='Lucida Console'>(</font><font color='#BB00BB'>tester</font><font face='Lucida Console'>(</font>rects[i],rect<font face='Lucida Console'>)</font><font face='Lucida Console'>)</font>
                <font color='#0000FF'>return</font> <font color='#979000'>true</font>;
        <b>}</b>
        <font color='#0000FF'>return</font> <font color='#979000'>false</font>;
    <b>}</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>inline</font> <font color='#0000FF'><u>bool</u></font> <b><a name='overlaps_any_box'></a>overlaps_any_box</b> <font face='Lucida Console'>(</font>
        <font color='#0000FF'>const</font> std::vector<font color='#5555FF'>&lt;</font>rectangle<font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> rects,
        <font color='#0000FF'>const</font> rectangle<font color='#5555FF'>&amp;</font> rect
    <font face='Lucida Console'>)</font>
    <b>{</b>
        <font color='#0000FF'>return</font> <font color='#BB00BB'>overlaps_any_box</font><font face='Lucida Console'>(</font><font color='#BB00BB'>test_box_overlap</font><font face='Lucida Console'>(</font><font face='Lucida Console'>)</font>,rects,rect<font face='Lucida Console'>)</font>;
    <b>}</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<b>}</b>

<font color='#0000FF'>#endif</font> <font color='#009900'>// DLIB_BOX_OVERlAP_TESTING_Hh_
</font>

</pre></body></html>